package com.whfc.emp.dao;

import com.whfc.emp.entity.AppEntryApplication;
import com.whfc.entity.dto.Apply.req.AppEntryApplicationReq;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

public interface AppEntryApplicationMapper {
    int insert(AppEntryApplication appEntryApplication);

    AppEntryApplication selectByPrimaryKey(Integer id);

    int updateByPrimaryKey(AppEntryApplication appEntryApplication);

    int deleteByPrimaryKey(Long id);

    List<AppEntryApplication> selectByCreator(Integer userId);

    List<AppEntryApplication> getAppEntryList(
            @Param("pidList") List<Integer> pidList,
            @Param("createUserId") Integer createUserId,
            @Param("entryTimeBegin") LocalDateTime entryTimeBegin,
            @Param("entryTimeEnd") LocalDateTime entryTimeEnd,
            @Param("leaveTimeBegin") LocalDateTime leaveTimeBegin,
            @Param("leaveTimeEnd") LocalDateTime leaveTimeEnd,
            @Param("approvalStatus") Integer approvalStatus
    );

    List<AppEntryApplication> selectByCreateUser(@Param("createUser") String createUser);

    List<AppEntryApplication> selectByTimeAndStatus(
            @Param("pidList") List<Integer> pidList,
            @Param("createUserId") Integer createUserId,
            @Param("entryTimeBegin") LocalDateTime entryTimeBegin,
            @Param("entryTimeEnd") LocalDateTime entryTimeEnd,
            @Param("leaveTimeBegin") LocalDateTime leaveTimeBegin,
            @Param("leaveTimeEnd") LocalDateTime leaveTimeEnd,
            @Param("approvalStatus") Integer approvalStatus
    );

}